package com.siyuanren.gcocp.facade;


import com.siyuanren.gcocp.common.web.bean.Token;

import java.util.Set;

/**
 * Created by   guwr
 * Project_name siyuanren
 * Path         com.siyuanren.gcocp.facade.JedisFacade
 * Date         2017/3/8
 * Time         17:14
 * Description  缓存操作
 */
public interface JedisFacade {

    Set<String> delByPattern(String pattern);

    Set<String> getByPattern(String pattern);

    Long hset(String key, String field, String value);

    String hget(String key, String field);

    Long hdel(String key, String field);

    Boolean hexists(String key, String field);

    String setex(String key, int seconds, String value);

    Long setnx(String key, String value);

    Long del(String key);

    Long zrem(String key, String member);

    String get(String key);

    String set(String key, String value);

    Long sadd(String key, String member);

    Boolean sismember(String key, String member);

    /**
     * 检查token是否存在
     *
     * @param token
     * @return
     */
    boolean tokenExist(String token);

    Token getByToken(String token);

    void logOut(String token);

    Set<String> zrange(String seatKey, long start, long end);

    Long zcard(String key);

    Set<String> zrangeByScore(String key, double min, double max);

    void zadd(String key, double score, String member);

    Boolean exists(String key);

    Long expire(String key, int seconds);
}
